<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php include_once '/lib/bootstrap.php'; ?>
	<head>
		<!-- $Id: answers.php 20 2012-08-27 18:55:18Z dev@arbrebinaire.com $ -->
		<!-- Displays a particular form answers using jQuery datatables (datatables.net) -->
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link rel="stylesheet"
        	href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/blitzer/jquery-ui.css" />
        <link rel="stylesheet" href="css/instaforms.css" />
        <script type="text/javascript"
        	src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script type="text/javascript"
        	src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
       	<script type="text/javascript"
        	src="https://jquery-ui.googlecode.com/svn/trunk/ui/i18n/jquery.ui.datepicker-fr.js"></script>
        <script type="text/javascript">
        			var ArbreBinaire = ArbreBinaire || {}
        			ArbreBinaire.lang = '<?php echo LANG ?>';
        			ArbreBinaire.endpoint_script_url = '<?php echo ENDPOINT_SCRIPT_URL ?>';
        		</script>
        <script type="text/javascript"
        	src="https://instaforms.googlecode.com/svn/trunk/js/com/arbrebinaire/instaforms/dictionary.js"></script>
        <script type="text/javascript"
        	src="https://javascript-arbrebinaire.googlecode.com/svn/trunk/com/arbrebinaire/utilities/forms/forms.js"></script>
        <script type="text/javascript"
        	src="https://javascript-arbrebinaire.googlecode.com/svn/trunk/com/arbrebinaire/utilities/string/string.js"></script>
        	<script type="text/javascript"
        	src="https://javascript-arbrebinaire.googlecode.com/svn/trunk/com/arbrebinaire/utilities/number/number.js"></script>
        	<script type="text/javascript"
        	src="https://javascript-arbrebinaire.googlecode.com/svn/trunk/com/arbrebinaire/utilities/ajax/ajax.js"></script>
        <script type="text/javascript"
        	src="https://javascript-arbrebinaire.googlecode.com/svn/trunk/com/arbrebinaire/i18n/i18n.js"></script>
        <script type="text/javascript"
        	src="js/net/datatables/jquery.dataTables.min.js"></script>
       	<script type="text/javascript"
			src="js/com/arbrebinaire/instaforms/main.js"></script>	
		
		
		<title><?php echo $imp->__('Answers'); ?></title>
		
	</head>
	<body>
	<table id="instaforms-datatable-answers" border="1">
        	<?php
        	    $formId = 1; 
        	    $table = $imp->getNormalizedAnswerTable($formId);
        	    foreach($table as $key => $row){
        	        if($key == 0){
        	            echo '<thead>';
        	            echo '<tr>';
            	        foreach($row as $answerPart){
            	            echo '<th>' . $answerPart . '</th>';
            	        }
            	        echo '</tr>';
            	        echo '</thead>';
            	        echo '<tbody>';
        	        }else{
        	            echo '<tr>';
            	        foreach($row as $answerPart){
            	            echo '<td>' . $answerPart . '</td>';
            	        }
            	        echo '</tr>';  
        	        }
        	    }
        	
        	?>
		</tbody>
	</table>
	</body>
</html>